home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1188 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.6 KB

  1. Subject: Re: another 1.10 job control bug?
  2. Date: Wed, 9 Mar 94 22:35:30 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4.         mint@atari.archive.umich.edu
  5. In-Reply-To: <199403090050.TAA20664@terminator.rs.itd.umich.edu>; from "Nicholas S Castellano" at Mar 8, 94 7:50 pm
  6. Message-Id: <9403092135.AA00931@jelal.north.de>
  7.  
  8. Nicholas S Castellano writes:
  9.  
  10. > My old routine definitely does have a bug...Juergen's patch (WITH THE
  11. > FIX I SENT OUT A DAY OR SO AGO) works a bit better.  For now, it would
  12. > be best to use that scheme, and perhaps modify getty slightly to take
  13. > any strange cases into account:  the first thing it should do is
  14. > "steal" the terminal from any existing processes that think they own
  15. > it, by changing the process group of the terminal.
  16.  
  17.  yes this is a patch i posted some time ago...  only i changed init not
  18. getty. :)
  19.  
  20. Index: init/init.c
  21. --- /i/tmp/init/init.c    Mon Aug  2 23:58:08 1993
  22. +++ /f/msrc/ini11/init/init.c    Tue Aug 24 13:14:56 1993
  23. @@ -44,6 +44,7 @@
  24.  #include <sys/resource.h>
  25.  
  26.  #ifdef MINT
  27. +#include <ioctl.h>
  28.  #include <sys/dir.h>
  29.  #include <mintbind.h>
  30.  
  31. @@ -493,12 +494,17 @@
  32.  
  33.      if ((pid = vfork()) == 0)
  34.      {
  35. -        setpgrp(getpid(), getpid());
  36. +        long pgrp = setpgrp(getpid(), getpid());
  37.  
  38.          tty = open(ttyname, O_RDWR);
  39.  
  40.  #ifdef MINT
  41. +        if (tty == -1 || pgrp < 0) {
  42. +            perror(ttyname);
  43. +            _exit(0);
  44. +        }
  45.          dup2(tty, -1);        /* set controlling terminal */
  46. +        ioctl (-1, TIOCSPGRP, &pgrp);
  47.  #endif
  48.          dup2(tty, 0);
  49.          dup2(tty, 1);
  50.  
  51.  cheers
  52.     Juergen
  53. -- 
  54. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  55.                                 ...ohne Gewehr
  56. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  57.